﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InformationSystem.BLL.Core.Model
{
    public class LoginUser : BaseClass
    {
        public LoginUser() { }

        private string _userName;
        public LoginUser(string userid, string loginpwd)
        {
            this.UserID = userid;
            this.LoginPwd = loginpwd;
        }
        /// <summary>
        /// 登陆时用户输入的ID
        /// </summary>
        public string UserID { get; set; }
        public string LoginPwd { get; set; }
        /// <summary>
        /// 如果当前用户为学生，返回家长的ID
        /// </summary>
        public string ParentID { get; set; }
        /// <summary>
        /// 如果当前用户为家长，返回小孩的ID
        /// </summary>
        public string StudentID { get; set; }
        public bool IsSystemAdmin { get; set; }
        public UserType LoginUserType { get; set; }
        public string UserName
        {
            get
            {
                if (LoginUserType == UserType.Parent)
                    return string.Format("{0}的家长", this._userName);
                else
                    return this._userName;
            }
            set
            { this._userName = value; }
        }

        public string Sex { get; set; }
        public DateTime Birthday { get; set; }
        public bool LoginDeny { get; set; }
        public DateTime LastLoginDateTime { get; set; }
        public int CollegeID { get; set; }
        public string CollegeName { get; set; }
        /// <summary>
        /// 如2010 2011 2012 入学年份
        /// </summary>
        public int GradeID { get; set; }

        public DateTime LastRefreshTime { get; set; }

    }
}
